﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WeChatV3Pay.Application.Refunds.Dtos
{
    public class FromItem
    {
        /// <summary>
        /// 
        /// </summary>
        public string account { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int amount { get; set; }
    }

    public class RefundsResponseAmount
    {
        /// <summary>
        /// 
        /// </summary>
        public int total { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int refund { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [JsonProperty("from")]
        public List<FromItem> From { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public int payer_total { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int payer_refund { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int settlement_refund { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int settlement_total { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int discount_refund { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string currency { get; set; }
    }

    public class Goods_detailItem
    {
        /// <summary>
        /// 
        /// </summary>
        public string merchant_goods_id { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string wechatpay_goods_id { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string goods_name { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int unit_price { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int refund_amount { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int refund_quantity { get; set; }
    }

    public class Promotion_detailItem
    {
        /// <summary>
        /// 
        /// </summary>
        public string promotion_id { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string scope { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string type { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int amount { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int refund_amount { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public List<Goods_detailItem> goods_detail { get; set; }
    }

    public class RefundsRes : WeChatBaseResponse
    {
        /// <summary>
        /// 微信支付退款单号
        /// </summary>
        [JsonProperty("refund_id")]
        public string RefundId { get; set; }

        /// <summary>
        /// 商户退款单号
        /// </summary>
        [JsonProperty("out_refund_no")]
        public string OutRefundNo { get; set; }

        /// <summary>
        /// 微信支付订单号
        /// </summary>
        [JsonProperty("transaction_id")]
        public string TransactionId { get; set; }

        /// <summary>
        /// 商户订单号
        /// </summary>
        [JsonProperty("out_trade_no")]
        public string OutTradeNo { get; set; }

        /// <summary>
        /// 退款渠道
        /// </summary>
        [JsonProperty("channel")]
        public string Channel { get; set; }

        /// <summary>
        /// 退款入账账户
        /// </summary>
        [JsonProperty("user_received_account")]
        public string UserReceivedAccount { get; set; }

        /// <summary>
        /// 退款成功时间
        /// </summary>
        [JsonProperty("success_time")]
        public string SuccessTime { get; set; }

        /// <summary>
        /// 退款创建时间
        /// </summary>
        [JsonProperty("create_time")]
        public string CreateTime { get; set; }

        /// <summary>
        /// 退款状态
        /// </summary>
        [JsonProperty("status")]
        public string Status { get; set; }

        /// <summary>
        /// 资金账户
        /// </summary>
        [JsonProperty("funds_account")]
        public string FundsAccount { get; set; }

        /// <summary>
        /// 金额信息
        /// </summary>
        public RefundsResponseAmount amount { get; set; }

        /// <summary>
        /// 优惠退款信息
        /// </summary>
        public List<Promotion_detailItem> promotion_detail { get; set; }
    }

}
